home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / kn / elate / exec / initevent.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  600 b   |  41 lines

  1.  
  2. #include "tek/kn/elate/exec.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TBOOL kn_initevent(TKNOB *event)
  10. **
  11. **    init kernel event.
  12. **
  13. */
  14.  
  15. TBOOL kn_initevent(TKNOB *event)
  16. {
  17.     if (sizeof(TKNOB) >= sizeof(ELATE_EVF))
  18.     {
  19.         if (kn_evf_init((ELATE_EVF *) event, 0) == 0)
  20.         {
  21.             return TTRUE;
  22.         }
  23.     }
  24.     else
  25.     {
  26.         ELATE_EVF *evt = kn_alloc(sizeof(ELATE_EVF));
  27.         if (evt)
  28.         {
  29.             if (kn_evf_init(evt, 0) == 0)
  30.             {
  31.                 *((ELATE_EVF **) event) = evt;
  32.                 return TTRUE;
  33.             }
  34.             kn_free(evt);
  35.         }
  36.     }
  37.  
  38.     dbkprintf(10,"*** TEKLIB kernel: could not create event\n");
  39.     return TFALSE;
  40. }
  41.